package com.livery.app.view.frame;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.List;

import javax.swing.JFrame;

import com.livery.app.controller.AbstractWorkspaceController;
import com.livery.app.model.AbstractWorkspaceModel;
import com.livery.app.model.observators.CarObserver;
import com.livery.app.model.observators.ClientObserver;
import com.livery.app.model.observators.TransactionObserver;
import com.livery.data.Car;
import com.livery.data.Client;
import com.livery.data.Transaction;

public class TransactionFrame extends JFrame implements TransactionObserver,
CarObserver, ClientObserver{

	private AbstractWorkspaceController controller;
	public TransactionFrame(AbstractWorkspaceController controller){
		super("Transakcje");
		this.setMinimumSize(new Dimension(800,600));
		this.addWindowListener	(new WindowAdapter(){ 
			public void windowClosing(WindowEvent e){ 
				setVisible(false);				
			}	
		});	

		Dimension dialogSize = getSize();		
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();  
		if(dialogSize.height > screenSize.height) 
			dialogSize.height = screenSize.height;
		if(dialogSize.width > screenSize.width)
			dialogSize.height = screenSize.width;
		setLocation((screenSize.width-dialogSize.width)/2,   
						(screenSize.height-dialogSize.height)/2);
		this.controller = controller;
	}

	@Override
	public void updateTransaction(List<Transaction> list) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void updateClient(List<Client> list) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void updateCar(List<Car> list) {
		// TODO Auto-generated method stub
		
	}
}
